home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2005 October / PCWOCT05.iso / Software / FromTheMag / The GIMP 2.2.8 / gimp-2.2.8-i586-setup.exe / {app} / share / gimp / 2.0 / scripts / clothify.scm < prev    next >
Encoding:
GIMP Script-Fu Script  |  2005-06-30  |  2.2 KB  |  64 lines

  1. ; CLOTHIFY version 1.02
  2. ; Gives the current layer in the indicated image a cloth-like texture.
  3. ; Process invented by Zach Beane (Xath@irc.gimp.net)
  4. ;
  5. ; Tim Newsome <drz@froody.bloke.com> 4/11/97
  6.  
  7. (define (script-fu-clothify timg tdrawable bx by azimuth elevation depth)
  8.     (let*
  9.         ((width (car (gimp-drawable-width tdrawable)))
  10.          (height (car (gimp-drawable-height tdrawable)))
  11.          (img (car (gimp-image-new width height RGB)))
  12.                     ;        (layer-two (car (gimp-layer-new img width height RGB-IMAGE "Y Dots" 100 MULTIPLY-MODE)))
  13.          (layer-one (car (gimp-layer-new img width height RGB-IMAGE "X Dots" 100 NORMAL-MODE)))
  14.          (layer-two)
  15.          (bump-layer))
  16.  
  17.       (gimp-context-push)
  18.  
  19.       (gimp-image-undo-disable img)
  20.  
  21.       (gimp-image-add-layer img layer-one 0)
  22.  
  23.       (gimp-context-set-background '(255 255 255))
  24.       (gimp-edit-fill layer-one BACKGROUND-FILL)
  25.  
  26.       (plug-in-noisify 1 img layer-one FALSE 0.7 0.7 0.7 0.7)
  27.  
  28.       (set! layer-two (car (gimp-layer-copy layer-one 0)))
  29.       (gimp-layer-set-mode layer-two MULTIPLY-MODE)
  30.       (gimp-image-add-layer img layer-two 0)
  31.  
  32.       (plug-in-gauss-rle 1 img layer-one bx TRUE FALSE)
  33.       (plug-in-gauss-rle 1 img layer-two by FALSE TRUE)
  34.       (gimp-image-flatten img)
  35.       (set! bump-layer (car (gimp-image-get-active-layer img)))
  36.  
  37.       (plug-in-c-astretch 1 img bump-layer)
  38.       (plug-in-noisify 1 img bump-layer FALSE 0.2 0.2 0.2 0.2)
  39.  
  40.       (plug-in-bump-map 1 img tdrawable bump-layer azimuth elevation depth 0 0 0 0 FALSE FALSE 0)
  41.       (gimp-image-delete img)
  42.       (gimp-displays-flush)
  43.  
  44.       (gimp-context-pop)))
  45.  
  46.  
  47. (script-fu-register "script-fu-clothify"
  48.             _"_Clothify..."
  49.             "Gives the current layer a cloth-like texture"
  50.             "Tim Newsome <drz@froody.bloke.com>"
  51.             "Tim Newsome"
  52.             "4/11/97"
  53.             "RGB* GRAY*"
  54.             SF-IMAGE       "Input image"    0
  55.             SF-DRAWABLE    "Input drawable" 0
  56.             SF-ADJUSTMENT _"Blur X"         '(9 3 100 1 10 0 1)
  57.             SF-ADJUSTMENT _"Blur Y"         '(9 3 100 1 10 0 1)
  58.             SF-ADJUSTMENT _"Azimuth"        '(135 0 360 1 10 1 0)
  59.             SF-ADJUSTMENT _"Elevation"      '(45 0 90 1 10 1 0)
  60.             SF-ADJUSTMENT _"Depth"          '(3 1 50 1 10 0 1))
  61.  
  62. (script-fu-menu-register "script-fu-clothify"
  63.              _"<Image>/Script-Fu/Alchemy")
  64.